package org.brownflat.fxdate.dao;

import org.brownflat.fxdate.model.Role;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

/**
 * &copy; Rupert Jones 2011
 */
@Repository
public class RoleDAO extends AbstractHibernateDAO<Role> {
    public RoleDAO() {
        super(Role.class);
    }

    public Role getAdministrator() {
        return (Role) getCriteria().add(Restrictions.eq("name", Role.ROLE_ADMIN)).uniqueResult();
    }
}
